package com.okq.service.Impl;

import com.okq.dao.MenuDao;
import com.okq.entity.Menu;
import com.okq.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 描述 : 菜单业务接口实现
 * 作者 : zdl
 * 日期 : 2017/6/28 13:47
 */
@Transactional // 启用事务机制
@Service
public class MenuServiceImpl implements IMenuService {

	@Autowired
	private MenuDao menuDao;

	@Override
	public Menu getMenuById(String id) {
		return menuDao.getMenuById(id);
	}

	@Override
	public List<Menu> listAllMenu() {
		return menuDao.listAllMenu();
	}

	@Override
	public List<Menu> listMenuByRoleId(String roleId) {
		return menuDao.listMenuByRoleId(roleId);
	}

	@Override
	public Map<String, Menu> mapMenuByRoleId(String roleId) {
		return menuDao.mapMenuByRoleId(roleId);
	}

	@Override
	public Map<String, Menu> mapMenuByLevel(Map<String, Menu> menuMap, Integer level) {
		return menuDao.mapMenuByLevel(menuMap, level);
	}

}
